package com.ruoyi.web.controller.bussiness;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bussiness.domain.TAiInvestorProfiles;
import com.ruoyi.bussiness.service.ITAiInvestorProfilesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 投资人管理Controller
 * 
 * @author ruoyi
 * @date 2025-07-16
 */
@RestController
@RequestMapping("/bussiness/profiles")
public class TAiInvestorProfilesController extends BaseController
{
    @Autowired
    private ITAiInvestorProfilesService tAiInvestorProfilesService;

    /**
     * 查询投资人管理列表
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:list')")
    @GetMapping("/list")
    public TableDataInfo list(TAiInvestorProfiles tAiInvestorProfiles)
    {
        startPage();
        List<TAiInvestorProfiles> list = tAiInvestorProfilesService.selectTAiInvestorProfilesList(tAiInvestorProfiles);
        return getDataTable(list);
    }

    /**
     * 导出投资人管理列表
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:export')")
    @Log(title = "投资人管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TAiInvestorProfiles tAiInvestorProfiles)
    {
        List<TAiInvestorProfiles> list = tAiInvestorProfilesService.selectTAiInvestorProfilesList(tAiInvestorProfiles);
        ExcelUtil<TAiInvestorProfiles> util = new ExcelUtil<TAiInvestorProfiles>(TAiInvestorProfiles.class);
        util.exportExcel(response, list, "投资人管理数据");
    }

    /**
     * 获取投资人管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(tAiInvestorProfilesService.selectTAiInvestorProfilesById(id));
    }

    /**
     * 新增投资人管理
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:add')")
    @Log(title = "投资人管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TAiInvestorProfiles tAiInvestorProfiles)
    {
        return toAjax(tAiInvestorProfilesService.insertTAiInvestorProfiles(tAiInvestorProfiles));
    }

    /**
     * 修改投资人管理
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:edit')")
    @Log(title = "投资人管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TAiInvestorProfiles tAiInvestorProfiles)
    {
        return toAjax(tAiInvestorProfilesService.updateTAiInvestorProfiles(tAiInvestorProfiles));
    }

    /**
     * 删除投资人管理
     */
    @PreAuthorize("@ss.hasPermi('bussiness:profiles:remove')")
    @Log(title = "投资人管理", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(tAiInvestorProfilesService.deleteTAiInvestorProfilesByIds(ids));
    }
}
